package poubelle.html;

public class HTMLSpan extends THTML {

	private String startWidget = "<span";
	private String endWidget = "</span>";
	private String nameWidget = " class=\"";
	private String onClick = " onclick=\"javascript:clic(";
	private String fonctionClick;
	private String fonctionDrag = " onmousedown=\"javascript:dragWidget(this.id);\"";
	private String idWidget = " id='";
	
	private boolean drag = false;
	
	protected String getStartWidget() {
		return startWidget + nameWidget + idWidget
				+ ((fonctionClick != null) ? onClick : "") 
				+ ((drag) ? fonctionDrag : "") 			 +" > ";
	}

	protected void setStartWidget(String startWidget) {
		this.startWidget = startWidget;
	}

	protected String getEndWidget() {
		return endWidget;
	}

	protected void setEndWidget(String endWidget) {
		this.endWidget = endWidget;
	}

	protected String getNameWidget() {
		return nameWidget;
	}

	protected void setNameWidget(String nameWidget) {
		this.nameWidget = ((nameWidget != null) ? this.nameWidget + nameWidget
				+ "\"" : "");
	}

	protected String getIdWidget() {
		return nameWidget;
	}

	protected void setIdWidget(String idWidget) {
		this.idWidget = ((idWidget !=null) ? this.idWidget+idWidget+"'" : "") ;
	}
	
	protected void setOnClickWidget(String fonction) {
		fonctionClick = fonction;
		this.onClick = ((fonction != null) ? this.onClick + fonction + ");\""
				: "");
	}
	
	protected void setOnMouseDownWidget(boolean drag) {
		this.drag = drag;
	}
}
